#include <iostream>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <set>
#include <unordered_set>
using namespace std;
typedef long long ll;
typedef unsigned long long Ull;
const int N=1e5+10;
ll a[N];
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
    }
    int ans=0;
    ll max=-1e12+10;
    int l=0;
    int p=1;
    int i=1;
    int c=0;
    while(i<n)
	{
		c++;
		ll num=0;
		int j=i; 
		for(i;i<j+p;i++)
		{
			num+=a[i];
		}
		if(num>max)
		{
			ans=c;
			max=num;
		}
		p*=2;
	}
	cout<<ans;

	return 0;
}

